<?php
/**
 *
 *
 *
 */
namespace Yz\modules\Users;
class Model_User
    extends Model_Default
    implements \Yz_Model_Interface
{


    /**
     *  @param string $login
     *  @return \ns\Item_User
     *  @throws ItemNotFound
     */
    public function fetchUserByLogin($login)
    {
        debug();
        $item = $this->selectItem('User');
        $action = $this->selectAction("selectByLogin");
        $action
            ->assignFields($item->describe())
            ->setLogin($login);

        $values = $action()->fetch();

        return $item->assignValues($values);
    }

    /**
     *  @param \ns\Item_User $user
     *  @return chainable
     *  @throws ItemNotFound
     */
    public function updateUserLoginTime(Item_User $user)
    {
        debug();

        return $this->updateItemById($user);
    }

} // class
